<?php $this->load->view('header') ?>

<!-- CONTENT -->
<div id="content">
<div class="column full">
		
		<div class="box">
		<div class="box-header">Tambah Pasien</div>
		<div class="box-content">
        <?php echo isAccess('klinik',get_data($uri,'from'),'view') ? anchor('klinik/'.get_data($uri,'from').'/view', '<span class="icon_text preview"></span>Daftar '.ucwords(get_data($uri,'from')), 'class="button white"') : ''; ?>
        <br /><br />      
        
            <?php if (isset($errorMessage)) : ?>
            	<div class="notification <?php echo ((isset($isSuccess) && $isSuccess) ? 'success' : 'error');?>"><?php echo $errorMessage; ?></div>
	        <?php endif; ?>    	
	        
	        <?php //if (!(isset($isSuccess) && $isSuccess)) : ?>
            <?php  echo form_open('klinik/pasien/edit/from/'.get_data($uri,'from').'/id/'.get_data($uri,'id').'/time/' . time(),array('name'=>'formAddPasien','id'=>'formAddPasien','class'=>'frModalLoad'),array('kirim'=>'kirim')); ?>
            <table>
                <tr>
                    <td width='150'><br />Tipe Pasien</td>
                    <td>
                        <br />
                        <?php if($listTipePasien) foreach($listTipePasien as $tipe):?>
                        	<?php echo form_radio('pasienTipe', $tipe, get_data($dataEdit,'pasienTipe') == $tipe ? TRUE : FALSE );?> <?php echo $tipe?>
                        <?php endforeach;?>
                    </td>
                </tr>
                <tr>
                    <td>Nama</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienNama','value'=>get_data($dataEdit,'pasienNama'), 'class'=> 'form-field width60'));?>
                    </td>
                </tr>
                <tr>
                    <td>Jenis Kelamin</td>
                    <td>
                        <br />
                        <?php if($listJenKel) foreach($listJenKel as $jenkel):?>
                        	<?php echo form_radio('pasienJenKel', $jenkel, get_data($dataEdit,'pasienJenKel') == $jenkel ? TRUE : FALSE );?> <?php echo $jenkel?>
                        <?php endforeach;?>
                    </td>
                </tr>
                <tr>
                    <td>Tempat Lahir</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienTmpLahir','value'=>get_data($dataEdit,'pasienTmpLahir'),'class'=>'form-field width60'));?>
                    </td>
                </tr>
                <tr>
                    <td>Tanggal Lahir</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienTglLahir','value'=>get_data($dataEdit,'pasienTglLahir'),'class'=>'form-field small','id'=>'date'));?>
                    </td>
                </tr>
                <tr>
                    <td>No Telp</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienNoTelp','value'=>get_data($dataEdit,'pasienNoTelp'),'class'=>'form-field width60'));?>
                    </td>
                </tr>
                <tr>
                    <td valign='top'><br />Alamat</td>
                    <td>
                        <br /><?php echo form_textarea(array('name'=>'pasienAlamat','value'=>get_data($dataEdit,'pasienAlamat'),'class'=>'form-field full'));?>
                    </td>
                </tr>
                <tr>
                    <td>Pekerjaan</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienPekerjaan','value'=>get_data($dataEdit,'pasienPekerjaan'),'class'=>'form-field width60'));?>
                    </td>
                </tr>
                <tr>
                    <td>Agama</td>
                    <td>
                        <br />
                        <?php echo form_dropdown('pasienAgama', $listAgama, get_data($dataEdit,'pasienAgama'));?>
                    </td>
                </tr>
                <tr>
                    <td>Status Kawin</td>
                    <td>
                        <br />
                        <?php if($listKawin) foreach($listKawin as $kawin):?>
                        	<?php echo form_radio('pasienKawin', $kawin, get_data($dataEdit,'pasienKawin') == $kawin ? TRUE : FALSE );?> <?php echo $kawin?>
                        <?php endforeach;?>
                    </td>
                </tr>
                <tr>
                    <td>Gol. Darah</td>
                    <td>
                        <br />
                        <?php echo form_dropdown('pasienGolDarah', $listGolDarah, get_data($dataEdit,'pasienGolDarah'));?>
                    </td>
                </tr>
                <tr>
                    <td>Nama Penanggung</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienNamaPenanggung','value'=>get_data($dataEdit,'pasienNamaPenanggung'),'class'=>'form-field width60'));?>
                    </td>
                </tr>
                <tr>
                    <td valign='top'><br />Alamat Penanggung</td>
                    <td>
                        <br /><?php echo form_textarea(array('name'=>'pasienAlamatPenanggung','value'=>get_data($dataEdit,'pasienAlamatPenanggung'),'class'=>'form-field full'));?>
                    </td>
                </tr>
                <tr>
                    <td>Hubungan</td>
                    <td>
                        <br /><?php echo form_input(array('name'=>'pasienHubunganPenanggung','value'=>get_data($dataEdit,'pasienHubunganPenanggung'),'class'=>'form-field width60'));?>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <?php echo form_submit('submit','Simpan', 'class="button themed"');?>
                    </td>
                </tr>
            </table>
            </form>
            <br />
			<?php //endif;?>
			
          </div>
        </div>
      </div>
      <!-- End Widget-->
      
      <div class="clear"></div>
    </div>
  </div>
  
<script type="text/javascript">
<!--
jQuery(document).ready(function($){
	//Date
	$('#date').datepicker({
	   yearRange: "-90:+10",
	   dateFormat: 'yy-mm-dd',
	   maxDate: 'd', 
	   showButtonPanel: true,
	   changeMonth: true,
	   changeYear: true
	});
});
//-->
</script>  
<?php $this->load->view('footer') ?>